home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / amigaoscd / amigapluscd / AP-Website / news / admin / add_news.php < prev    next >
PHP Script  |  2002-01-27  |  900b  |  33 lines

  1. <?php
  2.     
  3.     $server = "db04.puretec.de";
  4.     $db = "db24905524";
  5.     $login = "p343302";
  6.     $pass = "90f42902";
  7.     
  8.     $dbwww = mysql_connect($server,$login,$pass);
  9.     mysql_select_db($db,$dbwww);
  10.  
  11.     if($title==""||$newstext=="")
  12.         $error = "Titel und Text müssen mindestens ausgefüllt sein!";
  13.  
  14.     if($target=="")
  15.         $target = "_blank";
  16.  
  17.     $timestamp = time();
  18.     $query = "insert into amigaplusnews_content (timestamp, title, link, source, text, category, author, target) values ('$timestamp','$title','$link','$source','$newstext','$category','$author','$target')";
  19.     
  20.     if(!$error)
  21.     {
  22.         mysql_query($query,$dbwww);
  23.         header("Location: index.php");
  24.     }
  25.  
  26. ?>
  27. <html>
  28. <head><title>Fehler</title></head>
  29. <body bgcolor="#66CCFF" text="#000000">
  30. <?php echo $error ?><br>(Weiter mit dem Back-Button des Browsers)
  31. </body>
  32. </html>
  33.